<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
	  xmlns:p="http://primefaces.org/ui">  

<h:head>
	<link rel="StyleSheet" type="text/css" href="css/controlaSistema.css" media="screen" />
		<style>
		  	.lista-sistemas-cadastrados .ui-datalist-content
		  	{
		  		border:none !important;
		  	}
		  	
		  .ui-widget-content{
		  		background:#F5F5F5;
		  }
		
		</style>
		
		<script>
			function timer()
			{
				window.location.reload();
			}
			
			setTimeout("timer()", 300000);
		</script> 
		
</h:head>
 
<body> 

	<f:metadata>
  		<f:event type="preRenderView" listener="#{controlaSistemaMB.buscaSistemasEUrls()}"/>
  	</f:metadata>
  	
  	
	
	<h:graphicImage value="./resoursers/imagens/capgov.png" styleClass="imagem"/>
	
	<p:panel styleClass="painel2">
 		<p:menubar style="font-size:14px; border: none !important; height: 40px; background-color: transparent !important">  
			<p:submenu label="INICIO" icon="ui-icon-home"> 
				<p:menuitem value="SISTEMAS" url="http://localhost:8080/treinamento-web/sistema.xhtml" icon="ui-icon-arrowreturnthick-1-w" />					            
			</p:submenu>
			  
			<p:submenu label="CONTROLE" icon="ui-icon-pencil">  
				<p:menuitem value="ANDAMENTO" url="http://localhost:8080/treinamento-web/controlaSistema.xhtml" icon="ui-icon-arrowreturnthick-1-w" />  
			</p:submenu> 
        </p:menubar> 
					    		
		<p:growl id="growl" showDetail="true" sticky="false"/>	
			
			<h:form id="form">	
				<p:dataList id="lista-sistemas" styleClass="lista-sistemas-cadastrados" value="#{controlaSistemaMB.sistemas}" var="sistema" itemType="none" rowIndexVar="index" rendered="#{controlaSistemaMB.sistemaMB.sistemas.size() > 0}">					
					<p:panel toggleTitle="Maximizar conteúdo" toggleable="true" toggleSpeed="500" collapsed="true" styleClass="painel1">
						
						<f:facet name="header">
							#{sistema.nomeSistema}					 
							<h:panelGroup layout="block"  styleClass="bolinha">
								<h:graphicImage value="./resoursers/imagens/verde1.png" rendered="#{controlaSistemaMB.disponibilidadeAtualSistema(sistema)==1}"  style="height:20px;" styleClass="bolinha"/>
 	 							<h:graphicImage value="./resoursers/imagens/amarela.png"  rendered="#{controlaSistemaMB.disponibilidadeAtualSistema(sistema)==2}" style="height:20px;" styleClass="bolinha"/>
 	 							<h:graphicImage value="./resoursers/imagens/vermelha.png"  rendered="#{controlaSistemaMB.disponibilidadeAtualSistema(sistema)==3}" style="height:20px;" styleClass="bolinha"/>
							</h:panelGroup>									
						</f:facet>
						
						<h:panelGroup>												
								<h:outputText value="Informações" style="display:block; margin-top:20px; margin-bottom:17px;" styleClass="titulo"/>						
									<h:panelGrid columns="4">
																							
										<h:dataTable id="lista-urls" value="#{sistema.urls}" var="url" itemType="none" rowIndexVar="index" rendered="#{sistema.urls.size() > 0}">						
											<p:column>
										<h:outputText value="Url:" styleClass="url"/>
										</p:column>
											
											<p:column>	
												<h:outputLink value="#{url.nomeUrl}" styleClass="link" target="_blank"> #{url.nomeUrl} </h:outputLink>
											</p:column>
																															
										</h:dataTable> 	
																														

										
									<h:dataTable id="lista-quedas" value="#{sistema.urls}"  var="quedas" itemType="none" rowIndexVar="index" rendered="#{sistema.urls.size() > 0}">
										<p:column>
										<h:outputText value="Quedas: " styleClass="url"/>
										<h:outputText id="quedas-totais" value="#{quedas.totalQuedas}" styleClass="quedas"/>
										</p:column>			
									</h:dataTable> 
									
									<h:dataTable id="lista-url" value="#{sistema.urls}"  var="url" itemType="none" rowIndexVar="index" rendered="#{sistema.urls.size() > 0}">
											<p:column>		
												<h:graphicImage id="bol1" value="./resoursers/imagens/verde1.png" rendered="#{controlaSistemaMB.disponibilidadeAtualUrl(url)==1}"  style="height:16px;" styleClass="bolinha2"/>
			 	 								<h:graphicImage id="bol2" value="./resoursers/imagens/amarela.png"  rendered="#{controlaSistemaMB.disponibilidadeAtualUrl(url)==2}"  style="height:16px;" styleClass="bolinha2"/>
			 	 								<h:graphicImage id="bol3" value="./resoursers/imagens/vermelha.png"  rendered="#{controlaSistemaMB.disponibilidadeAtualUrl(url)==3}"  style="height:14px;" styleClass="bolinha2"/>
											</p:column>
									</h:dataTable> 
									
									</h:panelGrid>							
									
										
						</h:panelGroup>
						
					</p:panel>
							
				</p:dataList>							
			</h:form>									 
	</p:panel>	
</body> 
</html>